<template>
  <el-popconfirm title="这是一段内容确定删除吗？">
    <div class="cascader-popover" slot="reference" @click="handleShowPopover">
      <span class="placeholder">请选择</span>
      <i
        :class="[
          'el-icon-arrow-up el-icon-arrow',
          isAcitve ? 'el-icon-arrow-change' : ''
        ]"
      ></i>
    </div>
  </el-popconfirm>
</template>

<script>
export default {
  name: "CascaderPopover",
  data() {
    return {
      isAcitve: false
    };
  },

  components: {},

  methods: {
    handleShowPopover() {
      this.isAcitve = !this.isAcitve;
    }
  }
};
</script>

<style lang="scss" scoped>
.cascader-popover {
  width: 180px;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  box-sizing: border-box;
  color: #606266;
  display: inline-block;
  height: 40px;
  line-height: 40px;
  outline: 0;
  padding: 0 15px;
  cursor: pointer;
  position: relative;

  .placeholder {
    color: #c0c4cc;
  }

  .el-icon-arrow {
    height: 40px;
    line-height: 40px;
    color: #c0c4cc;
    font-size: 14px;
    transform: rotateZ(180deg);
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 10px;
    transition: all 0.3s;

    &.el-icon-arrow-change {
      transition: all 0.3s;
      transform: rotateZ(0);
    }
  }

  &:hover {
    border-color: #c0c4cc;
  }

  &:focus {
    border-color: #409eff;
  }
}
</style>
